﻿using System;
using System.Net.Mail;
using System.Data.SqlClient;



public partial class _Default : System.Web.UI.Page 
{
    MSSQLHelp.SqlDbHelper _sqlhelp = new MSSQLHelp.SqlDbHelper();
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void Bt_Send_Click(object sender, EventArgs e)
    {  
        SmtpClient mySmtp = new SmtpClient("smtp.qq.com");
        mySmtp.Credentials = new System.Net.NetworkCredential("746436329@qq.com", "pan0jun0wei!@12");
        string pcontect = "测试内容";
        MailMessage msgMail = new MailMessage();
        msgMail.From = new MailAddress("746436329@qq.com");
        msgMail.To.Add("1994458806@qq.com");
        msgMail.Subject = "信件主旨";
        AlternateView alt = AlternateView.CreateAlternateViewFromString(pcontect, null, "text/html");
        msgMail.AlternateViews.Add(alt);
        mySmtp.Send(msgMail);
    }
}